Skip to main content

1.5.2 Save command window work sessions as a script

Work already performed in the command window can easily be transferred into a script for further editing. This can be done in four ways:

  • In the script window there is a menu button at the top left. There you can select "Nytt skript med historikk fra kommandolinjen" ("New script with command line history"). Remember to enter a name for the script in the line above the script window. The script will then be saved with this name.

  • Use the command history in the command window. This returns a chronological list of all commands run, which can be copied into the script window by clicking on the copy button that will appear when holding the mouse cursor over, and then using the CTRL + C keyboard combination. Remember to create a name for the script also in this case.

  • In the command window, you can write the command save followed by an optional name that you use for the script. The name can consist of letters, numbers and "underscore" (_), and does not need to be surrounded by quotation marks, e.g. save Analysis_1. If you want to use spaces or other characters/symbols in the name, you must use quotation marks around the name, e.g. save "Analysis 1 - draft". But then the script is saved with a name where the quotation marks become part of the name. However, you can remove these from the script name in the line above your script afterwards. With this procedure, you do not need to name the script in the script window afterwards, since it is created automatically.

  • Instead of using save, you may use the edit command. This is similar save in that your work in the command window is automatically entered into the existing / active script in the script window. But be aware that the existing script is overwritten with the new content. This command is useful when you want to run a script where you send the result to the command window (see section 1.5.3), and then test it out and add new commands there. Edit then makes sure that your new commands are easily added to the script you ran.